<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:rich="http://richfaces.org/rich"
   xmlns:a="http://richfaces.org/a4j"
   template="/layout/default.xhtml">

   <ui:define name="content">


		<a:repeat var="blogEntry" value="#{blogEntryListService.resultList}">
			<div style="padding-bottom: 10px;">
				<h2>#{blogEntry.title}</h2>

					<div style="color: #AAAAAA; font-size: smaller;">
					#{blogEntry.author.firstname}, #{blogEntry.author.surname}
					-
					<h:outputText value="#{blogEntry.created}">
						<f:convertDateTime pattern="dd-MM-yyyy" />
					</h:outputText>
				</div>
			</div>

			<div style="clear:both;">#{blogEntry.shortContent}</div>

			<div style="padding-bottom: 10px; margin: 10px 0px 30px 0px; border-bottom: 1px solid; border-color: #AAAAAA;">
				<h:link outcome="/blogEntry.xhtml" value="Read more &#187;">
					<f:param name="id" value="#{blogEntry.id}"/>
				</h:link>
			</div>
		</a:repeat>

		<div>
			<h:link style="float:left;" rendered="#{blogEntryListService.previousExists}" value="&#171; Previous Page">
				<f:param name="result" value="#{blogEntryListService.previousFirstResult}"/>
			</h:link>

			<h:link style="float:right;" rendered="#{blogEntryListService.nextExists}" value="Next Page &#187;">
				<f:param name="result" value="#{blogEntryListService.nextFirstResult}"/>
			</h:link>
		</div>


   </ui:define>
</ui:composition>
